<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    new Promise((resolve,reject) => {
      console.log('new Promise');
      resolve('success');
    });
    console.log('finish');
    

    Promise.resolve(1).then(res => {
      console.log(res);
      return 2;
    }).then(res => {
      console.log(res);
    });

    //await 例子
    let a = 0;
    let b = async () => {
      a = a + await 10
      console.log('b',a);
    }
    b();
    a++;
    console.log('a',a);
    
    
    
    </script>
</body>
</html>